import java.util.ArrayList;

/*
 * SpellBok är en arraylist där varje attack läggs till som ett objekt.
 */
public class SpellBook {
	private ArrayList<AttackName> attacks;
	
	public SpellBook() {
		attacks = new ArrayList<AttackName>();
	}
	
	public SpellBook(ArrayList<AttackName> attacks) {
		this.attacks = attacks;
	}
	
	public SpellBook copy() {
		return new SpellBook(attacks);
	}
	
	public ArrayList<AttackName> getAttacks() {
		return attacks;
	}
	
	public void addItem(AttackName attack) {
		Boolean attackExists=false;
		for(int i=0; i<attacks.size(); i++){
			if(attacks.get(i).name()== attack.name()){
				attackExists=true;
			}
		}
		if(attackExists==false){
			attacks.add(attack);
		}
	}

	public void removeItem(AttackName attack) {
		attacks.remove(attack);
	}
	
}
